Skip to content

Use Provider API to read version.txt and changes.md files #399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 13, 2023

Conversation

tylerbertrand
Copy link
Member

@tylerbertrand tylerbertrand commented Apr 12, 2023

  • Add release notes to githubRelease body
  • Use Provider.fileContents() to read changes.md and version.txt files

Tests

Execute ./gradlew githubRelease with dryRun.set(true)

:githubRelease [This task is a dry run. All API calls that would modify the repo are disabled. API calls that access the repo information are not disabled. Use this to show what actions would be executed.]
:githubRelease [CHECKING FOR PREVIOUS RELEASE]
:githubRelease [EXISTING RELEASE FOUND https://github.com/gradle/gradle-enterprise-build-validation-scripts/releases/tag/development-latest]
:githubRelease [DELETING RELEASE Development Build]
:githubRelease [CREATING NEW RELEASE 
{
    tag_name               = development-latest
    target_commitish       = main
    name                   = Development release
    generate_release_notes = false
    body                   = 
        - [FIX] Logging level when fetching Build Scan data from Gradle Enterprise is incorrect 
                - [FIX] Experiments accepting Build Scan URLs incorrectly parse Build Scan ID when path contains extra parts
    draft                  = false
    prerelease             = true
}]

And with finalRelease property set...

:githubRelease [This task is a dry run. All API calls that would modify the repo are disabled. API calls that access the repo information are not disabled. Use this to show what actions would be executed.]
:githubRelease [CHECKING FOR PREVIOUS RELEASE]
:githubRelease [CREATING NEW RELEASE 
{
    tag_name               = v2.3.4
    target_commitish       = main
    name                   = 2.3.4
    generate_release_notes = false
    body                   = 
        - [FIX] Logging level when fetching Build Scan data from Gradle Enterprise is incorrect 
                - [FIX] Experiments accepting Build Scan URLs incorrectly parse Build Scan ID when path contains extra parts
    draft                  = false
    prerelease             = false
}]

Configuration Cache Compatibility

Modifying version.txt results in a new configuration cache entry being stored, and the dry run githubRelease uses the updated version.

Modifying changes.md results in a new configuration cache entry being stored, and the dry run githubRelease uses the updated body.

Running with no changes results in the configuration cache entry being re-used.

@tylerbertrand tylerbertrand marked this pull request as ready for review April 12, 2023 22:39
@tylerbertrand tylerbertrand changed the title Use Provider API to read version and changes files Use Provider API to read version.txt and changes.md files Apr 12, 2023
@etiennestuder etiennestuder self-requested a review April 13, 2023 01:36
Copy link
Member

@etiennestuder etiennestuder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Tyler.

@tylerbertrand tylerbertrand force-pushed the tylerbertrand/version-provider branch from f3dbf5e to b20651d Compare April 13, 2023 16:59
@tylerbertrand tylerbertrand force-pushed the tylerbertrand/version-provider branch 2 times, most recently from 0d7b1f7 to 421f57c Compare April 13, 2023 22:45
Add release notes to githubRelease body
* Leverage Provider.fileContents() to support configuration caching when reading release notes file

Use configuration-cache-compatible Provider API to read version file
* Use configuration-cache-compatible Provider.fileContents() to read version file
@tylerbertrand tylerbertrand force-pushed the tylerbertrand/version-provider branch from 421f57c to 7c7f5a6 Compare April 13, 2023 23:06
@tylerbertrand tylerbertrand merged commit eed0515 into main Apr 13, 2023
@tylerbertrand tylerbertrand deleted the tylerbertrand/version-provider branch April 13, 2023 23:08
@tylerbertrand tylerbertrand restored the tylerbertrand/version-provider branch April 17, 2023 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants